var str = prompt("请输入网址");
var res = str.replace(/^www.\w+.com$/.exec(str)[0],"www.lagou.com");
alert(res);